using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
using WindowsPhoneGame1.GamePlayStates;

namespace WindowsPhoneGame1.GameScreens
{
    class MainMenuScreen : Screen
    {
        
        public MainMenuScreen(Game1 game) : base(game)
        {
            NUMBER_OF_BUTTONS = 3;
        }

        public override void Initialize()
        {
            // call base.Initialize first!
            base.Initialize();

            button_functions[0] = PressButton1;
            button_functions[1] = PressButton2;
            button_functions[2] = PressButton3;
            //button_functions[3] = PressButton4;

            //Deze Buttons moeten in het midden...
            button_rectangle[0] = new Rectangle(237, 75, 394, 144);
            button_rectangle[1] = new Rectangle(237, 233, 394, 120);
            button_rectangle[2] = new Rectangle(237, 357, 394, 120);
        }

        public override void LoadContent()
        {
            button_texture[0] =
                game.Content.Load<Texture2D>(@"images/ui/buttons/play");
            button_texture[1] =
                game.Content.Load<Texture2D>(@"images/ui/buttons/challenge");
            button_texture[2] =
                game.Content.Load<Texture2D>(@"images/ui/buttons/credits");
            /*button_texture[3] =
                game.Content.Load<Texture2D>(@"images/BoringButton");
            */
            base.LoadContent();
        }

        public override void UnloadContent()
        {
            base.UnloadContent();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            game.GraphicsDevice.Clear(background_color);
            base.Draw(gameTime);
        }

        /* button press functions */
        private bool PressButton1(int world, int level)
        {
            background_color = Color.Green;
            game.SetScreen(new WorldSelectScreen(game));
            return true;
        }

        

        private bool PressButton2(int world, int level)
        {
            background_color = Color.Yellow;
            return true;
        }

        private bool PressButton3(int world, int level)
        {
            background_color = Color.Red;
            return true;
        }

        /*
        private bool PressButton4(int world, int level)
        {
            background_color = Color.Blue;
            return true;
        }
         */
    }
}
